package com.itheima.web.service.impl.ums;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.service.ums.MemberLevelService;
import com.itheima.utils.ResultData;
import com.itheima.vo.ums.MemberLevel;
import com.itheima.web.mapper.ums.MemberLevelMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper , MemberLevel> implements MemberLevelService {


    @Autowired
    private MemberLevelMapper memberLevelMapper;
    /**
     * 查询所有会员等级
     * @param defaultStatus
     * @return
     */
    @Override
    public ResultData defaultStatusList(Integer defaultStatus) {

        LambdaQueryWrapper<MemberLevel> lqw=new LambdaQueryWrapper<>();
        lqw.eq(MemberLevel::getDefaultStatus,defaultStatus);
        List<MemberLevel> data = memberLevelMapper.selectList(lqw);
        return ResultData.ok("操作成功",data);
    }
}
